package com.lsy.android.pingpang.bluetooth;

import android.bluetooth.BluetoothAdapter;

public class BluetoothManager {

	private static BluetoothAdapter sAdapter = BluetoothAdapter
			.getDefaultAdapter();

	public static boolean isEnable() {
		return sAdapter.isEnabled();
	}

	public synchronized static boolean open() {
		if (!sAdapter.isEnabled()) {
			return sAdapter.enable();
		} else {
			return true;
		}
	}

	public synchronized static boolean close() {
		if (sAdapter.isEnabled()) {
			return sAdapter.disable();
		} else {
			return true;
		}
	}

}
